#ifndef SEMANTICNODEBLOCKCREATE_H_
#define SEMANTICNODEBLOCKCREATE_H_

#include "SemanticNode.h"
#include "LabeledNode.h"
#include <string>
#include <vector>

class SemanticNodeExpression;

class SemanticNodeBlockCreate : public SemanticNode, public LabeledNode {
private:
	SemanticNodeExpression *uptoExpression; // int
	SemanticNodeExpression *afterExpression; // time
	SemanticNodeExpression *everyExpression; // time
	SemanticNodeExpression *deviationExpression; // time
	std::string name;
	std::vector<std::pair<std::string, SemanticNodeExpression *> > transactionList; // float
	std::string sendToName;
	bool upto, after, every, deviation, transList, sendTo;

	friend std::string flattenNamePeriodAdd(const SyntaxTreeNode &nameNode);

public:
	SemanticNodeBlockCreate(const SyntaxTreeNode *createNodeParent, SemanticNode *parent);

	void setUptoExpression(SemanticNodeExpression *upto);
	void setAfterExpression(SemanticNodeExpression *after);
	void setEveryExpression(SemanticNodeExpression *every);
	void setDeviationExpression(SemanticNodeExpression *deviation);

	void addTransaction(std::string name, SemanticNodeExpression *probability);

	bool hasUpto();
	bool hasAfter();
	bool hasEvery();
	bool hasDeviation();
	bool hasTransactionList();
	bool hasSendTo();

	virtual std::string toDebugString(int tab);
};

#endif /* SEMANTICNODEBLOCKCREATE_H_ */
